def sum_base(*params):
    len_params = len(params)
    if params[len_params-1] == 5:
        mm=0
        for x in range(len_params-1):
            mm += int(params[x])
        mm1=mm*5
    else:
        mm=0
        for x in range(len(params)):
            mm += int(params[x])
        mm1 = mm * 3
    print(mm1)
